<?php

namespace App\Observers;

use App\Models\Carbarn;

class CarbarnObserver
{
    /**
     * Handle the carbarn "created" event.
     *
     * @param  \App\Models\Carbarn  $carbarn
     * @return void
     */
    public function created(Carbarn $carbarn)
    {
        $carbarn->runStates()->create([
            'carbarnCode' => $carbarn->code,
        ]);
    }

    /**
     * Handle the carbarn "updated" event.
     *
     * @param  \App\Models\Carbarn  $carbarn
     * @return void
     */
    public function updated(Carbarn $carbarn)
    {
        //
    }

    /**
     * Handle the carbarn "deleted" event.
     *
     * @param  \App\Models\Carbarn  $carbarn
     * @return void
     */
    public function deleted(Carbarn $carbarn)
    {
        //
    }

    /**
     * Handle the carbarn "restored" event.
     *
     * @param  \App\Models\Carbarn  $carbarn
     * @return void
     */
    public function restored(Carbarn $carbarn)
    {
        //
    }

    /**
     * Handle the carbarn "force deleted" event.
     *
     * @param  \App\Models\Carbarn  $carbarn
     * @return void
     */
    public function forceDeleted(Carbarn $carbarn)
    {
        //
    }
}
